package com.course.controller;

import com.course.component.http.Crp;
import com.course.dto.reqs.RequestUser;
import com.course.masterservice.UserMasterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Copyright: Copyright (c)  林中小鸟  All rights reserved.
 * @author: moon
 * @date: 2022/9/20 11:17
 * @Description: **********************
 */
@RestController
@RequestMapping(value = "/x/user")
public class UserController {

    @Autowired
    private UserMasterService userMasterService;

    @GetMapping(value = "/list")
    public Crp list(RequestUser requestUser){
        return Crp.success(userMasterService.list(requestUser));
    }

    @DeleteMapping(value = "del")
    public Crp del(@RequestBody RequestUser requestUser){
        return Crp.success(userMasterService.del(requestUser));
    }

    @PostMapping(value = "edit")
    public Crp edit(@RequestBody RequestUser requestUser){
        return Crp.success(userMasterService.update(requestUser));
    }
}
